/**
 * 
 */
package ao.com.bna.util;

/**
 * @author Administrador
 * 
 */
public final class Consulta {
	//-----------------------------------------------------------------------------------
	//-----------------------------------------------------------------------------------
	public static final String DMFAS_MOEDA = ""
			+ "select distinct moeda.cu_base as id, moeda.cu_base as descricao "
			+ "from tranches moeda " + "order by moeda.cu_base ";
	//-----------------------------------------------------------------------------------
	public static final String SIGMA_MOEDA = ""
			+ "select distinct issue.currency as id, issue.currency as descricao "
			+ "from issue@sigma_db_link_test issue "
			+ "order by issue.currency ";
	//-----------------------------------------------------------------------------------
	public static final String DMFAS_SIGMA_MOEDAGLOBAL = ""
			+ "select distinct moedas.* "
			+ "from ((select distinct tra.cu_base as id, tra.cu_base as descricao "
			+ "		from tranches tra) "
			+ "	   union "
			+ "	   (select distinct issue.currency as id, issue.currency as descricao "
			+ "	 	from issue@sigma_db_link_test issue)) moedas "
			+ "order by moedas.id ";
	//-----------------------------------------------------------------------------------
	//-----------------------------------------------------------------------------------
	public static final String DMFAS_DEVEDOR = ""
			+ "select distinct pa.pa_id, pa.name, pa.addr_ln1 "
			+ "from loan_part lp, parts pa "
			+ "where lp.cd_partyp = '10' and pa.pa_id = lp.pa_id "
			+ "order by pa.name ";
	//-----------------------------------------------------------------------------------
	//-----------------------------------------------------------------------------------
	public static final String SIGMA_PARTICIPANTE = ""
			+ "select pa.id  as pa_id, pa.lo_name as name, pa.lo_address as addr_ln1 "
			+ "from participant@sigma_db_link_test pa "
			+ "order by pa.lo_name ";

	public static final String SIGMA_DEVEDOR = ""
			+ "select distinct pa.id  as pa_id, pa.lo_name as name, pa.lo_address as addr_ln1 "
			+ "from issue@sigma_db_link_test issue, "
			+ "participant@sigma_db_link_test pa "
			+ "where issue.issuer_id = pa.id order by pa.lo_name ";
	//-----------------------------------------------------------------------------------
	//-----------------------------------------------------------------------------------
	public static final String DMFAS_SIGMA_DEVEDORGLOBAL = ""
			+ "select pa.*  "
			+ "from ((select distinct pa2.id as pa_id, TO_CHAR(pa2.lo_name) as name, TO_CHAR(pa2.lo_address) as addr_ln1 "
			+ "       from issue@sigma_db_link_test issue,  "
			+ "            participant@sigma_db_link_test pa2  "
			+ "       where issue.issuer_id = pa2.id ) "
			+ "		 union all "
			+ "      (select distinct pa.pa_id as pa_id, TO_CHAR(pa.name) as name, TO_CHAR(pa.addr_ln1) as addr_ln1 "
			+ "       from loan_part lp, parts pa  "
			+ "       where lp.cd_partyp = '10' and   pa.pa_id = lp.pa_id )) pa ";

}
